package com.wunong.smart.bigdata.jdk;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

/**
 * @author created by zealot.zt
 */
public class SumJoinTaskClient {

    public static void main(String[] args) throws Exception {
        ForkJoinPool pool = new ForkJoinPool();

        final int from = 1;
        final int end = 10;

        // 执行任务
        ForkJoinTask<Integer> task = pool.submit(new SumJoinTask(from, end));

        // 输出信息
        System.out.println("[" + from + "," + end + "] sum:" + task.get());
    }

}